import fs from 'fs/promises'
// import { join } from 'path'

export async function dirIsExit(file) {
  try {
    const stats = await fs.stat(file)
    return stats.isDirectory()
  } catch (error) {
    return false
  }
}

export async function readAsBuffer(file) {
  return fs.readFile(file)
}

export async function writeFile(file, buffer) {
  return fs.writeFile(file, buffer)
}
